-
Notifications
You must be signed in to change notification settings - Fork 10
Adds an spherical basis that is an exact deprojection of an exponential surface density #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Conversation
…l disk as an option to EmpCylSL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a new spherical “exponential deprojection” density model (based on the Abel inversion / modified Bessel (K_0)) and wires it into the cylindrical EOF basis generation as the new default option, with an additional configurable scale-length bias factor and a small test driver.
Changes:
- Introduces
ExpDeprojprofile implementation (density + tabulated enclosed-mass) and exposes it as a selectableEmpCylSLmodel (ExpSphere). - Switches the default spherical model for
EmpCylSLEOF generation to the new deprojected exponential-sphere option and updates cache validation to include the model label. - Adds a
biasconfiguration parameter to rescale the effective disk scale length used for basis construction; adds atestEDexecutable.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
utils/Test/testED.cc |
Adds a small executable to numerically re-project the deprojected density and compare against an exponential surface density. |
utils/Test/CMakeLists.txt |
Builds the new testED utility. |
src/Cylinder.cc |
Adds bias config support and applies it to the scale length passed into the cylindrical basis constructor. |
src/Cylinder.H |
Documents and stores the new bias parameter. |
include/ExpDeproj.H |
Declares the new ExpDeproj profile helper. |
include/EmpCylSL.H |
Adds ExpSphere to EmpModel and stores a precomputed ExpDeproj instance. |
exputil/ExpDeproj.cc |
Implements ExpDeproj density and tabulated/interpolated enclosed mass. |
exputil/EmpCylSL.cc |
Makes ExpSphere the default model, routes densR/massR to ExpDeproj, adds debug output, and tightens HDF5 cache validation via model. |
exputil/CMakeLists.txt |
Compiles ExpDeproj.cc into exputil. |
expui/BiorthBasis.cc |
Adds bias, changes default mtype, and expands mtype parsing to include the new model. |
expui/BiorthBasis.H |
Stores the new bias parameter in the cylindrical basis configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Fix divide-by-zero in ExpDeproj::initialize() when ngrid < 2
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com>
Revert incorrect naming changes - ExpSphere is the correct model name
Add input validation for bias parameter in cylindrical basis
Summary
Adds an spherical basis that is an exact deprojection of an exponential surface density. Specifically, using the Abel inversion, the exponential surface density
$$\qquad\Sigma(R)=\Sigma_0 e^{-R/a}$$ $R>0$ deprojects to
$$\qquad\rho(r)=\frac{\Sigma_0}{\pi a} K_0\left(\frac{r}{a}\right).$$
for
Implementation
The exact deprojected spherical basis is the default in this branch and has the ascii tag
ExpDeproj. The previous default wasExponential. The cumulative mass needed bySLGridSphis analytic but only in terms of modified Bessel and Struve functions. The latter is not available in the stdlib. The cumulative mass is computed using brute-force quadrature instead.Note
I would recommend renaming
ExpDeprojtoExponentialand delete the older, original implementation. I've left both for testing.